package com.exam.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.achievement.entity.Course;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.paper.entity.Paper;

@Entity
@Table(name="t_exam")
public class Exam {
	private Long id;
	private String name;
	private String num;
	private Date date; //为空则为【取消考试】
	private String location;
	private Course course;
	private Paper paper;
	private boolean marked;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	public String getNum() {
		return num;
	}
	public Date getDate() {
		return date;
	}
	public String getLocation() {
		return location;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public Course getCourse() {
		return course;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public Paper getPaper() {
		return paper;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setNum(String num) {
		this.num = num;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	public void setPaper(Paper paper) {
		this.paper = paper;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isMarked() {
		return marked;
	}
	public void setMarked(boolean marked) {
		this.marked = marked;
	}
	
}
